#ifndef ESP_NOW_HAL_H
#define ESP_NOW_HAL_H

#define ESP_NOW_HAL_DEBUG 1

#ifdef __cplusplus
extern "C"
{
#endif

    typedef enum
    {
        RECV_STATUS,
        LIVING_ROOM_LIGHT,
        LIVING_ROOM_FAN,
        LIVING_ROOM_AIR_C,
        LIVING_ROOM_SMART_TV,
        LIVING_ROOM_AIR_P,
        BED_ROOM_LIGHT,
        BED_ROOM_FAN,
        BED_ROOM_AIRC
    } esp_now_switch_data_type;

    typedef struct
    {
        bool light_switch;
        bool fan_switch;
        bool air_C;
        bool smart_TV;
        bool air_P;
    } esp_now_hal_living_room_t;

    typedef struct
    {
        bool light_switch;
        bool fan_switch;
        bool air_C;
    } esp_now_hal_bed_room_t;

    typedef struct
    {
        char *esp_now_recv_data;
        bool status;
        esp_now_hal_living_room_t esp_now_hal_living_room;
        esp_now_hal_bed_room_t esp_now_hal_bed_room;
    } esp_now_hal_data_t;

    void esp_now_set_broadcast_addr(uint8_t addr_param[6]);
    uint8_t *get_espnow_broadcast_addr(void);
    void esp_now_send_data(char *esp_now_data);
    bool esp_now_get_switch_status(esp_now_switch_data_type data_t);
    void esp_now_clear_rec_status(void);
    void esp_now_wifi_init(void);
    uint8_t esp_now_get_channel(void);
    void esp_now_task(void *arg);

#ifdef __cplusplus
}
#endif

#endif
